package com.gk.javaservice.util.backups;

import java.io.*;

public class BackupsToTerminal {


        public static void main(String[] args) throws Exception {
            String srcPath = "G:\\迅雷下载\\阳光电影www.ygdy8.com.罗小黑战记.HD.1080p.国语中字.mp4";
            File parentDir = new File("\\\\192.168.10.227\\datas");
//            File targetPath = new File(parentDir,
//                    UUID.randomUUID().toString().replaceAll("-", "") + ".mp4");

            File targetPath = new File(parentDir, "阳光电影www.ygdy8.com.罗小黑战记.HD.1080p.国语中字.mp4");
            InputStream in = new FileInputStream(srcPath);
            OutputStream out = new FileOutputStream(targetPath);
            try {
                byte[] bs = new byte[1024];
                int len = -1;
                while((len = in.read(bs)) != -1) {
                    out.write(bs, 0, len);
                }
            } finally {
                try {
                    out.close();
                } catch (Exception e) {
                    e.printStackTrace();
                }
                try {
                    in.close();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            // System.out.println("上传成功！！");
        }


}
